//
//  GPContactModel.m
//  Keping
//
//  Created by 23 on 2017/12/7.
//  Copyright © 2017年 柯平. All rights reserved.
//

#import "GPContactModel.h"
#import "GPConversationItem.h"

@implementation GPContactModel

/**通过GPConversationItem转换成当前对象*/
- (instancetype)initWithConversation:(GPConversationItem *)conversation
{
    if (self = [super init]) {
        
        _nickName = conversation.title;
        _profile = conversation.avatarURLPath;
        _phone   = conversation.conversation.conversationId;
        _partyId = conversation.uid;
        
        _subTitle = conversation.lastMsgContent;
        _context = conversation;
        
        _unRead = conversation.unreadCount;

    }
    return self;
}

@end
